/* 检索搜索
 */

import { getRequest } from '@/lib/axios'

interface SearchApi {
  regionList: (param?: any) => Promise<any>
  levelList: (param?: any) => Promise<any>
  storeList: (param?: any) => Promise<any>
  salesmanList: (param?: any) => Promise<any>
  dealerList: (param?: any) => Promise<any>
  dealerGoodsList: (param?: any) => Promise<any>
  brandList: (param?: any) => Promise<any>
  goodsList: (param?: any) => Promise<any>
  cateList: (param?: any) => Promise<any>
  driverList: (param?: any) => Promise<any>
  warehouseGoodsList: (param?: any) => Promise<any>
  warehouseList: (param?: any) => Promise<any>
  warehouseAreaList: (param?: any) => Promise<any>
  warehouseLocationList: (param?: any) => Promise<any>
  supplierList: (param?: any) => Promise<any>
  roleList: (param?: any) => Promise<any>
  authList: (param?: any) => Promise<any>
  userList: (param?: any) => Promise<any>
  searchPinyin: (param?: any) => Promise<any>
  bookOrderGoodsList: (param?: any) => Promise<any>
  displayTemplate: (param?: any) => Promise<any>
}

export const searchApi: SearchApi = {
  // 片区列表
  regionList: (param) => {
    return getRequest('/search/region', param)
  },
  // 门店类型列表
  levelList: (param) => {
    return getRequest('/search/store_level', param)
  },
  // 门店列表
  storeList: (param) => {
    return getRequest('/search/store', param)
  },
  // 业务员列表
  salesmanList: (param) => {
    return getRequest('/search/salesman', param)
  },
  // 经销商
  dealerList: (param) => {
    return getRequest('/search/dealer', param)
  },
  // 经销商商品
  dealerGoodsList: (param) => {
    return getRequest('/search/dealer_goods', param)
  },
  // 品牌
  brandList: (param) => {
    return getRequest('/search/brand', param)
  },
  // 商品列表
  goodsList: (param) => {
    return getRequest('/search/goods', param)
  },
  // 商品分类列表
  cateList: (param) => {
    return getRequest('/search/cate', param)
  },
  // 仓库商品
  warehouseGoodsList: (param) => {
    return getRequest('/search/warehouse_goods', param)
  },
  // 司机列表
  driverList: (param) => {
    return getRequest('/search/driver', param)
  },
  // 仓库列表
  warehouseList: (param) => {
    return getRequest('/search/warehouse', param)
  },
  // 库区列表
  warehouseAreaList: (param) => {
    return getRequest('/search/warehouse_area', param)
  },
  // 库位列表
  warehouseLocationList: (param) => {
    return getRequest('/search/warehouse_location', param)
  },
  // 供应商列表
  supplierList: (param) => {
    return getRequest('/search/supplier', param)
  },
  // 角色列表
  roleList: (param) => {
    return getRequest('/search/role', param)
  },
  // 权限列表
  authList: (param?: any) => {
    return getRequest('/search/auth', param)
  },
  // 用户列表
  userList: (param?: any) => {
    return getRequest('/search/user', param)
  },
  // 查询拼音
  searchPinyin: (param?: any) => {
    return getRequest('/goods/pinyin', param)
  },
  // 某门店预订货商品列表
  bookOrderGoodsList: (param?: any) => {
    return getRequest('/search/book_order_goods_list', param)
  },
  // 陈列模版
  displayTemplate: (param?: any) => {
    return getRequest('/search/display_template', param)
  }
}
